'use strict';
const { verifyToken } = require("../../../uniCloud-aliyun/cloudfunctions/common/wx-common");
const db = uniCloud.database();
exports.main = async (event, context) => {
	console.log('event : ', event)
	const payload = event.token?verifyToken(event.token):null;
	const userId=event.userId
	const dbRes = await db.collection('orders').where({
	    status: "进行中",
		userId
	  }).orderBy('created_at', 'desc').get();
	//返回数据给客户端
	return dbRes
};